-- GENERATED SPELL FOR [Marmot] --


function spell0_22189(pUnit, Event) --@Acorn Toss,n/a--
pUnit:FullCastSpellOnTarget(38605,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22189', 0, 1)
end

function spell1_22189(pUnit, Event) --@Poison Keg,n/a--
pUnit:FullCastSpellOnTarget(38629,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22189', 538, 1)
end

function spell2_22189(pUnit, Event) --@Stealth,Self--
pUnit:FullCastSpellOnTarget(42347,pUnit)
pUnit:RegisterEvent('Sorts_22189', 540, 1)
end

function Sorts_22189(pUnit, Event)
local choix_sorts_22189 = math.random(0, 2)
if choix_sorts_22189 == 0 then
pUnit:RegisterEvent('spell0_22189', 1, 1)
end
if choix_sorts_22189 == 1 then
pUnit:RegisterEvent('spell1_22189', 1, 1)
end
if choix_sorts_22189 == 2 then
pUnit:RegisterEvent('spell2_22189', 1, 1)
end
end

function mob22189_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22189', math.random(1500, 3000), 1)
end

function mob22189_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22189_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22189_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22189, 1, 'mob22189_Action')
RegisterUnitEvent(22189, 2, 'mob22189_Leave')
RegisterUnitEvent(22189, 3, 'mob22189_Kill')
RegisterUnitEvent(22189, 4, 'mob22189_Die')
